﻿using System.Collections.Generic;

namespace Roulette
{
    public class VegasRouletteGame : IGame
    {
        static readonly double possibilities = 38d;
        static readonly double eighteenProbability = 18d / possibilities;
        static readonly double twelveProbability = 12d / possibilities;
        static readonly double quartetProbability = 4d / possibilities;
        static readonly double duoProbability = 2d / possibilities;
        static readonly double soloProbability = 1d / possibilities;

        public IEnumerable<Option> GetOptions()
        {
            return new Option[]
            {
               new Option()
               {
                   Name = "Even",
                   Outcomes = new Outcome[]
                   {
                       new Outcome
                       {
                           Gain = 1d,
                           Probability = eighteenProbability
                       }
                       ,
                       new Outcome
                       {
                           Gain = -1d,
                           Probability = 1d - eighteenProbability
                       }
                   }
               }
               ,
               new Option()
               {
                   Name = "1st 12",
                   Outcomes = new Outcome[]
                   {
                       new Outcome
                       {
                           Gain = 1d,
                           Probability = twelveProbability
                       }
                       ,
                       new Outcome
                       {
                           Gain = -1d,
                           Probability = 1d - twelveProbability
                       }
                   }
               }
               ,
               new Option()
               {
                   Name = "Quartet",
                   Outcomes = new Outcome[]
                   {
                       new Outcome
                       {
                           Gain = 1d,
                           Probability = quartetProbability
                       }
                       ,
                       new Outcome
                       {
                           Gain = -1d,
                           Probability = 1d - quartetProbability
                       }
                   }
               }
               ,
               new Option()
               {
                   Name = "Duo",
                   Outcomes = new Outcome[]
                   {
                       new Outcome
                       {
                           Gain = 1d,
                           Probability = duoProbability
                       }
                       ,
                       new Outcome
                       {
                           Gain = -1d,
                           Probability = 1d - duoProbability
                       }
                   }
               }
               ,
               new Option()
               {
                   Name = "Solo",
                   Outcomes = new Outcome[]
                   {
                       new Outcome
                       {
                           Gain = 1d,
                           Probability = soloProbability
                       }
                       ,
                       new Outcome
                       {
                           Gain = -1d,
                           Probability = 1d - soloProbability
                       }
                   }
               }
            };
        }
    }
}
